<?php

abstract class JDbAdapter
{
    /** @var Zend_Db_Adapter_Pdo_Mysql */
    protected static $dbAdapter;

    /**
     * @return Zend_Db_Adapter_Pdo_Mysql
     */
    public static function factory()
    {
        if (!isset(self::$dbAdapter)) {
            self::$dbAdapter = Zend_Db::factory(
                'Pdo_Mysql',
                array(
                    'host' => 'localhost',
                    'username' => 'root',
                    'password' => '',
                    'dbname' => 'HotDealDB',
                    'charset' => 'utf8'
                )
            );
        }

        return self::$dbAdapter;
    }
}